package com.shanzmoo.merchant.manage.api.manager.merchant;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.shanzmoo.db.module.merchant.domain.dto.MerchantOrderInfoDto;
import com.shanzmoo.db.module.merchant.domain.dto.MerchantOrderRefundDto;
import com.shanzmoo.db.module.merchant.domain.query.MerchantOrderQuery;
import com.shanzmoo.db.module.merchant.domain.vo.MerchantOrderVo;
import com.shanzmoo.db.module.merchant.service.IMerchantOrderService;
import com.shanzmoo.merchant.manage.api.domain.AuthUser;
import com.shanzmoo.merchant.manage.api.util.SecurityUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 订单管理manager
 * @author fs
 */
@Component
@RequiredArgsConstructor
public class MerchantOrderManager {
    private final IMerchantOrderService iMerchantOrderService;
    public IPage<MerchantOrderVo> pageList(MerchantOrderQuery query) {
        AuthUser authUser = SecurityUtil.getCurrentUser();
        query.setMerchantCode(authUser.getMerchantCode());
        return iMerchantOrderService.pageList(query);
    }
    public MerchantOrderVo info(MerchantOrderInfoDto infoDto) {
        return iMerchantOrderService.info(infoDto);
    }

    public void refund(MerchantOrderRefundDto refundDto) {
        //TODO 调用退款接口
    }
}
